package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

public interface CustomerService {
	// 查询所有未关联客户的列表
	@Path("/noassociationcustomers")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findNoAssociationCustomers();

	// 查询所有已关联客户的列表
	@Path("/associationfixedareacustomers/{fixedareaid}")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findHasAssociationFixedAreaCustomers(@PathParam("fixedareaid") String fixedAreaId);

	// 把客户关联到定区上,将所有客户的id 拼成字符串 1，2，3
	@Path("/associationcustomertofixedarea")
	@PUT
	public void associationCustomerToFixedArea(@QueryParam("customerIdStr") String customerIdStr,
			@QueryParam("fixedAreaId") String fixedAreaId);

	// 注册用户
	@Path("/customer")
	@POST
	@Consumes({ "application/xml", "application/json" })
	public void registCustomer(Customer customer);

	// 根据电话查询客户
	@Path("/findCustomerByTelephone/{telephone}")
	@GET
	@Produces({ "application/xml", "application/json" })
	public Customer findCustomerByTelephone(@PathParam("telephone") String telephone);

	// 修改客户类型
	@Path("/updateCustomerType/{telephone}")
	@PUT
	@Consumes({ "application/xml", "application/json" })
	public void updateCustomerType(@PathParam("telephone") String telephone);
	
	@Path("/login/{telephone}/{password}")
	@GET
	@Produces({"application/xml","application/json"})
	public Customer login(@PathParam("telephone") String telephone,@PathParam("password") String password);
	
	@Path("/findFixAreaIdByAddress/{address}")
	@GET
	@Produces({"application/xml","application/json"})
	public String findFixedAreaIdByAddress(@PathParam("address") String address);
}
